home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / kernel / genfun.c < prev    next >
C/C++ Source or Header  |  1997-04-16  |  3KB  |  105 lines

  1.  
  2.  
  3. /*  Copyright (c) 1993-1996 Algorithms Corporation  */
  4. /*  All rights reserved.  */
  5.  
  6.  
  7.  
  8.  
  9. /*  This file automatically generated by dpp - do not edit  */
  10.  
  11. #define    DPP_STRATEGY    2
  12. #define    DPP_FASTWIDE    0
  13.  
  14.  
  15.  
  16. #line 13 "genfun.d"
  17. #include <string.h> 
  18. #include "kernels.h" 
  19.  
  20. #define    CLASS    GenericFunction_c
  21. #define    ivType    GenericFunction_iv_t
  22.  
  23. #include "generics.h"
  24.  
  25. object    GenericFunction_c;
  26.  
  27. #include "genfun.iv"
  28.  
  29.  
  30.  
  31. #line 29 "genfun.d"
  32. imeth void GenericFunction_im_gInvalidObject(object self, int argn, object arg1)
  33.     char buf[256]; 
  34.  
  35.     sprintf(buf, "\nDynace: Generic %s passed an invalid object on arg %d.\n", gName(self), argn); 
  36.     if (argn != 1 && arg1) 
  37.         if (IsaClass(arg1)) 
  38.         sprintf(buf+strlen(buf), "First argument to generic %s was the class %s\n", gName(self), gName(arg1)); 
  39.     else 
  40.         sprintf(buf+strlen(buf), "First argument to generic %s was an instance of the %s class\n", gName(self), gName(ClassOf(arg1))); 
  41.     gError(self, buf); 
  42.  
  43. imeth void GenericFunction_im_gInvalidType(object self, int argn, object arg1, object cls, object arg)
  44.     char buf[320]; 
  45.  
  46.     sprintf(buf, "\nDynace: Generic %s passed an invalid object type on arg %d.\n", gName(self), argn); 
  47.     sprintf(buf+strlen(buf), "Expected an instance of %s\n", gName(cls)); 
  48.     sprintf(buf+strlen(buf), "Received an instance of %s\n", gName(ClassOf(arg))); 
  49.     if (argn != 1 && arg1) 
  50.         if (IsaClass(arg1)) 
  51.         sprintf(buf+strlen(buf), "First argument to generic %s was the class %s\n", gName(self), gName(arg1)); 
  52.     else 
  53.         sprintf(buf+strlen(buf), "First argument to generic %s was an instance of the %s class\n", gName(self), gName(ClassOf(arg1))); 
  54.     gError(self, buf); 
  55.  
  56. imeth char * GenericFunction_im_gName(object self)
  57. { GenericFunction_iv_t *iv = GetIVs(GenericFunction, self);
  58.     return iv->name; 
  59.  
  60. imeth int GenericFunction_im_gTrace(object self, int mode)
  61. { GenericFunction_iv_t *iv = GetIVs(GenericFunction, self);
  62.     int pmode = iv->trace; 
  63.     iv->trace = mode; 
  64.     return pmode; 
  65.  
  66. imeth objrtn GenericFunction_im_gCopy(object self)
  67.     return gShouldNotImplement(self, "gCopy/gDeepCopy"); 
  68.  
  69. objrtn GenericFunction_initialize(void) 
  70.     static int done = 0; 
  71.  
  72.  
  73.  
  74.  
  75.     if (done) 
  76.         return GenericFunction_c; 
  77.  
  78.     done = 1; 
  79.  
  80.  
  81.  
  82.     iMethodFor(GenericFunction, gInvalidObject, GenericFunction_im_gInvalidObject); 
  83.     iMethodFor(GenericFunction, gInvalidType, GenericFunction_im_gInvalidType); 
  84.     iMethodFor(GenericFunction, gName, GenericFunction_im_gName); 
  85.     iMethodFor(GenericFunction, gTrace, GenericFunction_im_gTrace); 
  86.     iMethodFor(GenericFunction, gCopy, GenericFunction_im_gCopy); 
  87.     iMethodFor(GenericFunction, gDeepCopy, GenericFunction_im_gCopy); 
  88.     return GenericFunction_c; 
  89.  
  90. #if 0 
  91.  
  92. cmeth objrtn GenericFunction_cm_gNewWithStr(object self, char *n){} 
  93.  
  94. #endif 
  95.